﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CommonLibrary;

namespace CustomControls.Menu
{
    public partial class MenuBarControl : UserControl
    {
        public MenuBarControl()
        {
            InitializeComponent();
            comboBox1.DataSource = ArmyConstants.PointValues;
            comboBox1.SelectedIndexChanged += new EventHandler(comboBox1_SelectedIndexChanged);
        }

        public event EventHandler onClose;
        public event EventHandler onTrash;
        public event EventHandler onSave;
        public event EventHandler onArmyPointsSelected;

        public int GetSelectedValue()
        {
            return int.Parse(comboBox1.Text);
        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            onArmyPointsSelected.Invoke(sender, e);
        }

        private void button1_Click(object sender, EventArgs e)
        {

        }

        private void button3_Click(object sender, EventArgs e)
        {
            onClose.Invoke(this, null);
        }

        private void trashButton_Click(object sender, EventArgs e)
        {
            onTrash.Invoke(this, e);
        }

        private void saveButton_Click(object sender, EventArgs e)
        {
            onSave.Invoke(this, e);
        }

    }
}
